<?php
header("Content-Type: text/html; charset=utf-8;");


require_once(dirname(__FILE__)."/../../../member/config.php");

if($cfg_ml->IsLogin())
{
    $myurl = $cfg_memberurl."/index.php?uid=".urlencode($cfg_ml->M_LoginID);
    if(!preg_match("#^http:#i", $myurl)) $myurl = $cfg_basehost.$myurl;
}else{
	echo '没有登录';
	exit();
}

$uid  = $cfg_ml->M_ID;
$orderID=trim($_GET['orderID']);

        if(preg_match ("/S-P[0-9]+RN[0-9]/",$orderID)) {
		    $row = $dsql->GetOne("SELECT oid,state FROM `#@__shops_orders` WHERE oid='$orderID' and userid='$uid'");
			if(is_array($row)){
		  		 $xxlarr['xstate']=$row['state'];
			}else{
		    	$xxlarr['xstate']=2;
			}

        }else if (preg_match ("/M[0-9]+T[0-9]+RN[0-9]/", $orderID)){
 		    $row = $dsql->GetOne("SELECT buyid,sta FROM `#@__member_operation` WHERE buyid ='$orderID' ");
			if($row['sta']==2){
		  		 $xxlarr['xstate']=1;
			}else{
		    	$xxlarr['xstate']=2;
			}          
        }


/*
    $row = $dsql->GetOne("SELECT oid,state FROM `#@__shops_orders` WHERE oid='$orderID' and userid='$uid'");
		if(is_array($row)){
		   $xxlarr['xstate']=$row['state'];
		}else{
		    $xxlarr['xstate']=2;
		}*/
		
       
		//$xxlarr['xstate']='1';
		echo json_encode($xxlarr);
		exit();
?>
		

	
	
